FROM openjdk:8
RUN mkdir -p /opt/yjnb/
ADD ./target/dream-admin.jar /opt/yjnb/dream-admin.jar
WORKDIR /opt/yjnb
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENV APP_NAME=dream-admin
EXPOSE 8080
ENV JAVA_OPTS=" -Xms500m -Xmx2000m -XX:+UseParallelGC -XX:MaxGCPauseMillis=100 -XX:PermSize=60M -XX:MaxPermSize=1000M -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./logs/"

ENTRYPOINT [ "sh", "-c", "java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /opt/yjnb/${APP_NAME}.jar" ]